package com.example.djetpack.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel


/**
 * Author: shuhong
 * Date: 2020/9/10 15:26
 * Description:
 */
class MyViewModel : ViewModel() {

    val mMessageLiveData : MutableLiveData<String> = MutableLiveData()

    fun fetchMessageData(){
        var thread = Thread(Runnable {
            Thread.sleep(3000)
            mMessageLiveData.postValue("I am ViewModel message")
        })
        thread.start()
    }
}